@import "../common/var.styl"
placeholder() {
  // Firefox
  &::-moz-placeholder {
    color: #c5c8ce;
    opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
  }
  // Internet Explorer 10+
  &:-ms-input-placeholder {
    color: #c5c8ce;
  }
  // Safari and Chrome
  &::-webkit-input-placeholder {
    color: #c5c8ce;
  }
}
.bin-input-wrapper {
  display: inline-block;
  width: 100%;
  position: relative;
  vertical-align: middle;
  line-height: normal;
  label {
    display: inline-block;
    width: 100%;
    height: auto;
  }
  &:hover {
    .bin-input-icon-clear {
      display: inline-block;
      cursor: pointer;
    }
  }
}
// 大小设置
.bin-input-wrapper-large {
  .bin-input-with-prefix {
    padding-left: 40px;
  }
  .bin-input-prefix, .bin-input-suffix {
    width: 40px;
    i {
      font-size: 18px;
      line-height: 40px;
    }
  }
  .bin-input-icon {
    line-height: 40px;
  }
}
.bin-input-wrapper-small {
  .bin-input-with-prefix {
    padding-left: 32px;
  }
  .bin-input-prefix, .bin-input-suffix {
    width: 32px;
    i {
      line-height: 32px;
    }
  }
  .bin-input-icon {
    line-height: 32px;
  }
}
.bin-input-wrapper-mini {
  .bin-input-with-prefix {
    padding-left: 28px;
  }
  .bin-input-prefix, .bin-input-suffix {
    width: 28px;
    i {
      line-height: 28px;
    }
  }
  .bin-input-icon {
    line-height: 28px;
  }
}

.bin-input {
  display: inline-block;
  width: 100%;
  height: 36px;
  line-height: 1.5;
  padding: 0 15px;
  font-size: 12px;
  border: 1px solid #dcdee2;
  border-radius: 4px;
  color: #515a6e;
  background-color: #fff;
  background-image: none;
  position: relative;
  cursor: text;
  transition: border .3s ease-in-out, background .3s ease-in-out, box-shadow .3s ease;
  placeholder()
  &:focus, &:hover {
    border-color: $color-primary;
  }
  &:focus {
    outline: 0;
    box-shadow: 0 0 0 2px rgba(45, 140, 240, .2);
  }
}
// 大小设置
.bin-input-large {
  height: 40px;
}

.bin-input-small {
  height: 32px;
}

.bin-input-mini {
  height: 28px;
}
//  图标部分
.bin-input-hide-icon .bin-input-icon, .bin-input-icon-clear, .bin-input-icon-validate {
  display: none;
}
.bin-input-icon {
  width: 36px;
  height: 36px;
  line-height: 36px;
  font-size: 16px;
  text-align: center;
  color: #808695;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 3;
}
.bin-input-icon-normal + .bin-input {
  padding-right: 36px;
}
.bin-input-with-prefix {
  padding-left: 36px;
}

.bin-input-prefix, .bin-input-suffix {
  width: 36px;
  height: 100%;
  text-align: center;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  i {
    font-size: 16px;
    line-height: 36px;
    color: #808695;
  }
}
.bin-input-suffix {
  left: auto;
  right: 0;
}
//  搜索
.bin-input-search-icon {
  cursor: pointer;
  transition: color .2s ease-in-out;
}
.bin-input-search {
  cursor: pointer;
  padding: 0 16px !important;
  background: #2d8cf0 !important;
  color: #fff !important;
  border-color: #2d8cf0 !important;
  transition: all .2s ease-in-out;
  position: relative;
  z-index: 2;
}
textarea.bin-input {
  max-width: 100%;
  height: auto;
  min-height: 32px;
  vertical-align: bottom;
  font-size: 14px;
  padding: 4px 7px;
}
.bin-input[disabled], fieldset[disabled] .bin-input {
  opacity: 1;
  cursor: not-allowed;
  background-color: #f9f9f9;
  color: #737d91;
}

